<template>
  <div class="list">
    <ul>
      <li v-for="(item, index) in List" :key="index">{{ item }}</li>
    </ul>
  </div>
</template>

<script>
import service from "../../utils/service";
export default {
  data() {
    return {
      List: [],
    };
  },
  mounted() {
    service({
      url: "/api/pro/categorylist",
      method: "get",
    }).then((res) => {
      res.data.data.forEach((element) => {
        this.List.push(element);
      });
    });
  },
};
</script>

<style scoped>
.list {
  margin-bottom: 50px;
}

li {
  width: 25%;
  height: 30px;
  line-height: 30px;
  background: #f66;
  border-bottom: 1px solid #666;
  padding-left: 20px;
}
</style>